package jnBase
{
	import ui.shiyan.SYJieGuoUI;
	
	public class PJieGuo extends SYJieGuoUI
	{
		public function PJieGuo()
		{
			super();
			size(1270,760);
		}
		override public function onAwake():void
		{
			// TODO Auto Generated method stub
			super.onAwake();
			this.dragArea="0,0,1275,80";
			panel.vScrollBar.autoHide=true;
		}
		/**
		 *将实验结果的值更新为实验报告的值。 
		 * 
		 * 
		 */		
		public function update():void{
		}
		/**
		 *关闭后 
		 * @param type
		 * 
		 */		
		override public function onClosed(type:String=null):void
		{
			// TODO Auto Generated method stub
			super.onClosed(type);
			ShiYanJieGuo.getInstance().event("close");
			if(this.active){
				updateBaogao();
				Laya.timer.clear(this,updateBaogao);
			}
		}
		
		/**
		 *实验结果打开时每1s提交一次数据 
		 * 
		 */		
		override public function onOpened(param:*):void
		{
			// TODO Auto Generated method stub
			super.onOpened(param);
			if(this.active){
				update();
				Laya.timer.loop(5000,this,updateBaogao);
			}
		}
		/**
		 *更新实验报告的值并将数据上传到服务器。 
		 * 
		 */		
		protected function updateBaogao():void{
			if(ShiYanBaoGao.getInstance().active){
				ShiYanBaoGao.getInstance().update();
				ShiYanBaoGao.getInstance().saveToLocal();
			}
		}
	}
}